package com.cx.service.serviceimp;

import com.cx.entity.PhStudent;
import com.cx.mapper.PhStudentMapper;
import com.cx.service.PhStudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @program: pms
 * @author: cx
 * @description:
 * @create: 2025-02-07 13:56
 **/
@Service
public class PhStudentServiceImpl implements PhStudentService {

    @Autowired
    private PhStudentMapper phStudentMapper;

    @Autowired
    private StringRedisTemplate stringRedisTemplate;

    @Override
    public int deleteByPrimaryKey(Integer id) {
        return phStudentMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(PhStudent record) {
        return phStudentMapper.insert(record);
    }

    @Override
    public int insertOrUpdate(PhStudent record) {
        return phStudentMapper.insertOrUpdate(record);
    }

    @Override
    public int insertOrUpdateSelective(PhStudent record) {
        return phStudentMapper.insertOrUpdateSelective(record);
    }

    @Override
    public int insertSelective(PhStudent record) {
        return phStudentMapper.insertSelective(record);
    }

    @Override
    public PhStudent selectByPrimaryKey(Integer id) {
        return phStudentMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPrimaryKeySelective(PhStudent record) {
        return phStudentMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(PhStudent record) {
        return phStudentMapper.updateByPrimaryKey(record);
    }

    @Override
    public int updateBatch(List<PhStudent> list) {
        return phStudentMapper.updateBatch(list);
    }

    @Override
    public int batchInsert(List<PhStudent> list) {
        return phStudentMapper.batchInsert(list);
    }

    @Override
    public List<PhStudent> getList(PhStudent phStudent) {
        phStudent.setOffSet((phStudent.getCurrentPage() - 1) * phStudent.getPageSize());
        return phStudentMapper.getList(phStudent);
    }

    @Override
    public int count(PhStudent phStudent) {
        return phStudentMapper.count(phStudent);
    }

}
